package com.woniuxy.hrp.mapper;

import com.woniuxy.hrp.entity.PaymentType;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/*
 * desc:支付类型
 * @Author: caojieke
 * @Date: 2022/8/29 11:21
 */
public interface PaymentTypeMapper {
    /*
     * desc:添加支付类型
     * @Author: caojieke
     * @Date: 2022/8/29 11:22
     */
    @Insert("insert into hrp_paymenttype values(null,#{name}")
    public void insert(PaymentType paymentType);
    /*
     * desc: 根据id查支付类型
     * @Param: [id]
     * @Return: [int]
     * @Author: caojieke
     * @Date: 2022/8/29 11:24
     */
    @Select("select * from hrp_paymenttype where id=#{id} ")
    public PaymentType selectById(int id);
    /*
     * desc: 查询所有的支付类型
     * @Param: []
     * @Return: []
     * @Author: caojieke
     * @Date: 2022/8/29 11:25
     */
    @Select("select * from hrp_paymenttype ")
    public List<PaymentType> selectAll();

    /**
     * desc:  根据id删除支付
     * @Param: [id]
     * @Return: [int]
     * @Author: caojieke
     * @Date: 2022/8/29 11:25
     */
    @Delete("delete from hrp_paymenttype where id=#{id} ")
    public void delectById(int id);

    /**
     * desc: 根据id修改支付类型
     * @Param: [name, id]
     * @Return: [java.lang.String, int]
     * @Author: caojieke
     * @Date: 2022/8/29 11:26
     */
    @Update("update hrp_paymenttype set name=#{name} where id=#{id} ")
    public void update(String name,int id);
}
